

//TODO a(34)
function a34(module, exports, a) {
    var i = a(23), s = a(6), r = a(3), n = (a(21), a(2)), o = function (e) {
        if (!e)throw"no video element";
        this.video = e
    };
    r.extend(o, i);
    var l = {
        init: function () {
            this.playerData = this.manager.playerData, this.seekId = null, this.preparePlayTimeout = null, this.eventFlag = {error: !1}, this.fullScreenObj = r.checkFullScreenFn(this.video), this.addEvent()
        }, addEvent: function () {
            var e = ["webkitendfullscreen", "canplaythrough", "stalled", "play", "playing", "pause", "waiting", "seeking", "seeked", "progress", "canplay", "ended", "durationchange", "loadstart", "loadeddata", "loadedmetadata", "timeupdate", "error"];
            r.each.call(this, e, function (e, t) {
                s(this.video).on(t, function (e) {
                    if (("error" != e.type || null != this.video.getAttribute("src") && 0 == this.getCurrentTime()) && ("waiting" != e.type && "stalled" != e.type || !this.playerData.videoFlag.preparePlay || this.playerData.videoFlag.startPlay)) {
                        if ("undefined" != typeof this.eventFlag[e.type]) {
                            if (this.eventFlag[e.type])return;
                            this.eventFlag[e.type] = !0
                        }
                        this.manager.evt.trigger(e.type)
                    }
                }, this)
            })
        }, eventPublicHandle: function (e) {
            this.manager.isDebug && "progress" != e && this.manager.log.pushLog("timeupdate" == e ? e + this.getCurrentTime() : e);
            var t = n.iPhone && n.iosVersion >= 10 && n.safari;
            ("playing" == e && t || "play" == e && !t) && !this.playerData.videoFlag.startPlay && (this.playerData.videoFlag.startPlay = !0, this.manager.log.pushLog("vjs_startPlay"), this.manager.evt.trigger("vjs_startPlay")), "loadstart" != e || this.playerData.videoFlag.preparePlay || this.playerData.videoFlag.startPlay || (clearTimeout(this.preparePlayTimeout), this.playerData.videoFlag.preparePlay = !0, this.manager.log.pushLog("vjs_preparPlay"), this.manager.evt.trigger("vjs_preparPlay"))
        }, setPreload: function (e) {
            this.video.setAttribute("preload", e ? "auto" : "none")
        }, setPlayInLine: function () {
            this.video.setAttribute("webkit-playsinline", "true"), this.video.setAttribute("playsinline", "true")
        }, setMute: function () {
            this.video.muted = !0
        }, setSrc: function (e) {
            this.manager.log.pushLog("set videoSrc: " + e), this.playerData.videoFlag.preparePlay = !1, this.playerData.videoFlag.startPlay = !1, this.eventFlag.error = !1;
            try {
                this.video.removeAttribute("src")
            } catch (t) {
            }
            try {
                this.video.src = e
            } catch (t) {
                this.video.setAttribute("src", e)
            }
            clearTimeout(this.preparePlayTimeout), this.preparePlayTimeout = setTimeout(r.bind(function () {
                this.playerData.videoFlag.startPlay || (this.playerData.videoFlag.preparePlay = !0, this.manager.log.pushLog("vjs_preparPlay(timeOut)"), this.manager.evt.trigger("vjs_preparPlay"))
            }, this), 5e3)
        }, setIIV: function () {
            s(this.video).addClass("IIV")
        }, getSrc: function () {
            return this.video.src || ""
        }, removeSrc: function () {
            try {
                this.video.pause(), this.video.removeAttribute("src")
            } catch (e) {
            }
        }, play: function () {
            this.video.play()
        }, pause: function () {
            this.video.pause()
        }, seek: function (e) {
            if (!isNaN(e)) {
                this.seekId && clearTimeout(this.seekId);
                var t = this, a = this.video.seekable;
                a ? 1 === a.length && a.end(0) > e ? this.video.currentTime = e : this.seekId = setTimeout(function () {
                            t.seek(e)
                        }, 1e3) : console.log("no seekable")
            }
        }, getCurrentTime: function () {
            try {
                return this.video.currentTime
            } catch (e) {
                return 0
            }
        }, getBuffered: function () {
            for (var e = this.video.buffered, t = e.length, a = 0, i = []; a < t;)i.push({
                start: e.start(a),
                end: e.end(a)
            }), a++;
            return i
        }, getDuration: function () {
            return this.video.duration
        }, setCrossOrigin: function (e) {
            this.video.crossOrigin = e
        }, changeFullScreen: function (e) {
            try {
                e ? this.fullScreenObj.requestEl[this.fullScreenObj.requestFn]() : this.fullScreenObj.cancelEl[this.fullScreenObj.cancelFn]()
            } catch (t) {
            }
        }
    };
    r.merge(o.prototype, l), module.exports = o
}

